/*
一、将下面异步代码使用Promise的方法改进
*/

/* setTimeout(function () {
    var a = 'hello'
    setTimeout(function () {
        var b = 'lagou'
        setTimeout(function () {
            var c = 'I ♥ U'
            console.log(a + b + c)
        }, 100);
    }, 100);
}, 100); */

new Promise(resolve => {
    setTimeout(() => {
        let a = 'hello'
        resolve(a)
    }, 10);
}).then(value => {
    return new Promise(resolve => {
        setTimeout(() => {
            let b = 'lagou'
            resolve(value + b)
        }, 10);
    })
}).then(value => {
    setTimeout(() => {
        let c = 'I ♥ U'
        console.log(value + c)
    }, 10);
})